<?php
require_once "common.php";
class navigation{
	private $pid;
	private $partName;//栏目名称
	private $aid;
	private $titleName;//文章内容页标题
	function __construct($pid,$aid){
		$this->pid=$pid;
		if($aid!=''){
			$this->aid=$aid;
		}
	}
	private function navigate(){
		@$part=new part();
		$this->partName=$part->getCol('part',$this->pid);
		if($this->aid!=''){
			@$article=new article();
			$this->titleName=$article->getCol('title',$this->aid);
		}
	}
	public function showNavigate(){
		$this->navigate();
		echo "当前位置：";
		if($this->aid!=''){
			echo "<a href=\"\">首页</a>>><a href=\"./list.php?pid=".$this->pid."\">".$this->partName."</a>>>".$this->titleName;
		}else{
			echo "<a href=\"\">首页</a>>>".$this->partName;
		}
	}
}
//测试
//$nav=new navigation(27,12);
//$nav->showNavigate();
?>